package com.example.Mapper;

import com.example.domain.Comment;
import org.apache.ibatis.annotations.*;



@Mapper //表示该类是一个mybatis接口文件，是需要被spring boot进行扫描的
public interface CommentMapper {
    //查询方法
    @Select("select*from t_comment where id=#{id} ")
    public Comment findById(Integer id);

    //添加方法
    @Insert("insert into t_comment values(#{id},#{content},#{author},#{aId})")
    public void insertComment(Comment comment);


    //修改
    @Update("updata t_comment set content=#{content} where id=#{id}")
    public void updataComment(Comment comment);

    //删除
    @Delete("delete from t_comment where id=#{id}")
    public void deleteComment(Integer id);
}
